<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script>
			function dizhi() {
				var n = document.getElementsByName("se");
				console.log(n);
				for (let o of n) {
					if (o.checked) {
						if (o.value == "guge") {
							tupian.src = "../作业/img/google_web.png";
						} else if (o.value == "baidu") {
							tupian.src = "../作业/img/baidu_web.png";
						} else if (o.value == "taobao") {
							tupian.src = "../作业/img/taobao_shopping.png";
						}
					}
				}
			}
			
			
			
			function sousuo() {
				var n = document.getElementsByName("se");
				console.log(n);
				for (let o of n) {
					if (o.checked) {
						if (o.value == "guge") {
							window.location.href = "https://www.google.com";
						} else if (o.value == "baidu") {
							window.location.href = "https://www.baidu.com";
						} else if (o.value == "taobao") {
							window.location.href = "https://www.taobao.com";
						}
					}
				}
			}
		</script>
	</head>
	<body>
		<div>
			<img id="tupian" src="../作业/img/baidu_web.png" />
			<input type="text" /><button type="button" onclick="sousuo()">搜索</button>
			<div onclick="dizhi()">
				<label><input type="radio" name="se" checked value="baidu" />百度</label>
				<label><input type="radio" name="se" value="guge" />谷歌</label>
				<label><input type="radio" name="se" value="taobao" />淘宝</label>
			</div>
		</div>
	</body>
</html>
